package com.tiger.jms.sample4;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class Sample4Client {
	public static void main(String args[]) {
		try {
			InitialContext ctx = new InitialContext();
			// Object obj = ctx.lookup("java:comp/env/ejb/PublisherBean");
			Object obj = ctx.lookup("comp/env/ejb/PublisherBean");
			PublisherHome publisherHome = (PublisherHome) PortableRemoteObject.narrow(obj, PublisherHome.class);
			Publisher publisher = publisherHome.create();
			publisher.publish("Hello");
			publisher.remove();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
